<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta content="text/html;charset=utf-8"></meta>
    <title>天猫首页</title>
    <script src="/jquery.min.js"></script>
    <script src="/jquery.cookie.min.js"></script>

</head>
<body>
<div class="container">
    <h1>欢迎访问天猫</h1>
    <h2>以下是用户信息:</h2>
<label>cookie:</label><span id="cookie"></span>
</div>
<script>

$(function () {
    $.ajax({
        type:'get',
        url:'${login_api}',
        dataType:'jsonp',
        jsonp:'callback',
        jsonpCallback:'success_jsonpcallback',
        success:function (json) {
            console.log(json);
            $("#cookie").html($.cookie("tb_nk"))
        },
        error:function (data) {
            $("#cookie").html($.cookie("tb_nk"))
        }
    });
})

</script>
</body>
</html>